ShowTable of Contents
Where to look for exceptions or errors
db2diag.log
About DB2 diagnostic log (db2diag.log) files:
If the STA throws a db2 error, you can get the error code with db2 ? SQL0000W (or whatever the code thrown is). If it is a sqlcode: db2 ? sqlcode 00001 or whatever the number is. Also, you can look them up in the documentation (
IBM DB2 Database for Linux UNIX and Windows Information Center
). There should be a link to online docs added when db2 is installed.
How to look for performance issues
Logging tables for the text indexes. (DOC)
Turning on the collection of statistics. Run the following from db2:
Note: It is important to keep the below command all on one line!
db2 update dbm cfg using DFT_MON_BUFPOOL on DFT_MON_LOCK on DFT_MON_SORT on DFT_MON_TABLE
on DFT_MON_UOW on DFT_MON_STMT on DFT_MON_TIMESTAMP on MON_HEAP_SZ 8192
without that, when you do a get snapshot, most of the numbers say "not collected". The command should be dynamic, but sometimes you may need to restart the db before it is picked up to reset the numbers to 0.
So, try:
db2 reset monitor for database
How to look for CPU heap issues for DB2
A database server should use most of the memory on the machine, but never more than is on the machine. So no swapping. One way memory can be managed by changing the bufferpool sizes. Memory must be set much smaller if the appserver is on the same machine as the db server.
When the db is created an autoconfigure command is used. (See blow for AUTOCONFIGURE usage) It shows how to use that command to see how your configuration settings compare with what it tells you. It is likely that you will want to change the bufferpool settings, and to set them to automatically (dynamically) change as needed
Sometimes, autoconfigure can set the bufferpool sizes too big for the db to start.
Using AUTOCONFIGURE
It is possible to modify the database configuration after installation. If the DBA desires to re-run the autoconfiguration command with different parameters, the command would be: "db2 AUTOCONFIGURE USING MEM_PERCENT 50 TPM 1500 ADMIN_PRIORITY PERFORMANCE ISOLATION UR APPLY NONE" This will provide output to the screen where the DBA can compare suggested settings to the current ones. One note is that for interactive performance, the AUTOCONFIGURE command will recommend small recovery logs, and no secondary recovery logs. While much of the use of the database is interactive, the index updates generate large transactions that require larger recovery logs than interactive use would. It is therefore recommended to retain the size and number of recovery logs rather than going with the AUTOCONFIGURE recommendation.
How to monitor CPU for DB2
See How to monitor CPU for EB.
DB2 database has been dropped and needs to be recreated
- Extract createDB.bat and orgcollab.ddl from ocpersistence.jar/config from a sta801 gold install
- Run createDB.bat dbname (this populated the database) from Program Files - IBM DB2 - DB2COPY1 - Command Line Processor
- Find security.xml and disable security (WAS\profiles\profile_name\config\cells\cell_name\security.xml, set security:Security .... enabled="true" to false)
- Restart WAS
- Add db2 client jars to WAS classpath
- In the admin console go to Servers - Applications servers and click server1
- Click on Java and Process Management and Select Process Definition
- Click on Java Virtual Machine
aste the following in to your classpath:
C:\Program Files\IBM\SQLLIB\java
C:\Program Files\IBM\SQLLIB\java\db2java.zip
C:\Program Files\IBM\SQLLIB\java\db2jcc.jar
C:\Program Files\IBM\SQLLIB\java\db2jcc_javax.jar
C:\Program Files\IBM\SQLLIB\java\db2jcc_license_cu.jar
(This is the path that the DB2 Client got installed into)
9. run wsadmin
10. run setupIdMgrDBTables command as follows:
Wait for message that the command has successfully completed.
11. Remove db2 client jars from WAS classpath
12. Re-enable security (find security.xml and set security:Security .... enabled="false" back to true)
13. Restart WAS